#include<cstdio>

int main()
{
	int x;
	scanf("%d",&x);
	int s1=0,s2=0;
	while(x)
	{
		int s=x%10;
		if(s%2)s1+=s;
		else s2+=s;
		x/=10;
	}
	printf("%d\n%d",s1,s2);
	return 0;
}
